package com.lanqiao.cloud.user.Controller;

import com.lanqiao.cloud.user.feign.ProductServiceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @author 王文凯
 * 未来的生活很潇洒
 * 未来的世界很自由
 */
@RestController
@RequestMapping("/api/users")
public class UserController {
    @Autowired
    RestTemplate restTemplate;

    @Autowired
    ProductServiceFeign productService;

    @RequestMapping("/getProducts")
    public List getProductList(){
        return productService.getProducts();
//        return restTemplate.getForObject("http://MICROSERVICE-PRODUCTS/api/products/",List.class);
    }
}
